package Beans;

public class PCB {
//    private static final int Ready=1;
//    private static final int Running=2;
//    private static final int Waiting=3;
    private int id;
    private String Pid;  //进程名
    private int timeRequired; //要求运行时间
    private int Priority;  //优先级
    private int status; //状态
    private PCB next; //指针
    private int timeWait; //等待时间
    private int storageRequierd;
    private int storageStart;

    public int getStorageRequierd() {
        return storageRequierd;
    }

    public void setStorageRequierd(int storageRequierd) {
        this.storageRequierd = storageRequierd;
    }

    public int getStorageStart() {
        return storageStart;
    }

    public void setStorageStart(int storageStart) {
        this.storageStart = storageStart;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPid() {
        return Pid;
    }

    public void setPid(String pid) {
        Pid = pid;
    }

    public int getTimeRequired() {
        return timeRequired;
    }

    public void setTimeRequired(int timeRequired) {
        this.timeRequired = timeRequired;
    }

    public int getPriority() {
        return Priority;
    }

    public void setPriority(int priority) {
        Priority = priority;
    }

    public void setStatus(int value) {
        status=value;
    }

    public String getStatusName(){
        switch (status) {
            case 1:return "NEW";
            case 2:return "READY";
            case 3:return "RUNNING";
            case 4:return "TERMINATED";
            default:return "";
        }
    }

    public int getStatusValue(){
        return status;
    }

    public PCB getNext() {
        return next;
    }

    public void setNext(PCB next) {
        this.next = next;
    }

    public int getTimeWait() {
        return timeWait;
    }

    public void setTimeWait(int timeWait) {
        this.timeWait = timeWait;
    }
}
